<controls:MetroWindow x:Class="LogGrok.Shell.PartiallyFileOpenDialog"
                      xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                      xmlns:avalon="clr-namespace:Xceed.Wpf.Toolkit;assembly=Xceed.Wpf.Toolkit"
                      xmlns:controls="clr-namespace:MahApps.Metro.Controls;assembly=MahApps.Metro"
                      Title="{Binding Path=FileName, StringFormat='Open File Partially ({0})'}"
                      Width="600"
                      GlowBrush="{DynamicResource AccentColorBrush}"
                      SaveWindowPosition="True"
                      ShowMinButton="False"
                      SizeToContent="Height"
                      WindowStartupLocation="CenterOwner">
    <controls:MetroWindow.Resources>
        <ResourceDictionary>
            <ResourceDictionary.MergedDictionaries>
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Controls.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Fonts.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Colors.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/Blue.xaml" />
                <ResourceDictionary Source="pack://application:,,,/MahApps.Metro;component/Styles/Accents/BaseLight.xaml" />
            </ResourceDictionary.MergedDictionaries>
        </ResourceDictionary>
    </controls:MetroWindow.Resources>
    <Grid Margin="10">
        <Grid.RowDefinitions>
            <RowDefinition Height="Auto" />
            <RowDefinition Height="10" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="10" />
            <RowDefinition Height="Auto" />
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>
        <Grid.ColumnDefinitions>
            <ColumnDefinition Width="Auto" />
            <ColumnDefinition />
        </Grid.ColumnDefinitions>
        <controls:RangeSlider Grid.ColumnSpan="2"
                              Margin="5,0,5,0"
                              AutoToolTipPlacement="TopLeft"
                              AutoToolTipPrecision="0"
                              LowerValue="{Binding StartOffset,
                                                   Mode=TwoWay,
                                                   UpdateSourceTrigger=PropertyChanged}"
                              Maximum="{Binding FileLength}"
                              MinRange="1"
                              UpperValue="{Binding EndOffset,
                                                   Mode=TwoWay,
                                                   UpdateSourceTrigger=PropertyChanged}" />
        <TextBlock Grid.Row="2"
                   Margin="5"
                   VerticalAlignment="Center"
                   FontSize="16"
                   Text="Start Offset:" />
        <controls:NumericUpDown Grid.Row="2"
                                Grid.Column="1"
                                Width="200"
                                Margin="5"
                                HorizontalAlignment="Left"
                                HorizontalContentAlignment="Left"
                                FontSize="16"
                                Maximum="{Binding FileLength}"
                                Minimum="0"
                                TextAlignment="Justify"
                                Value="{Binding StartOffset,
                                                Mode=TwoWay,
                                                UpdateSourceTrigger=PropertyChanged}" />
        <TextBox Grid.Row="3"
                 Grid.Column="0"
                 Grid.ColumnSpan="2"
                 MinHeight="100"
                 Margin="5"
                 IsReadOnly="True"
                 ScrollViewer.CanContentScroll="True"
                 ScrollViewer.HorizontalScrollBarVisibility="Auto"
                 ScrollViewer.VerticalScrollBarVisibility="Auto"
                 Text="{Binding StartText,
                                Mode=OneWay}" />
        <TextBlock Grid.Row="5"
                   Margin="5"
                   VerticalAlignment="Center"
                   FontSize="16"
                   Text="End Offset:" />
        <controls:NumericUpDown Grid.Row="5"
                                Grid.Column="1"
                                Width="200"
                                Margin="5"
                                HorizontalAlignment="Left"
                                HorizontalContentAlignment="Left"
                                FontSize="16"
                                Maximum="{Binding FileLength}"
                                Minimum="0"
                                TextAlignment="Justify"
                                Value="{Binding EndOffset,
                                                Mode=TwoWay,
                                                UpdateSourceTrigger=PropertyChanged}" />
        <TextBox Grid.Row="6"
                 Grid.Column="0"
                 Grid.ColumnSpan="2"
                 MinHeight="100"
                 Margin="5"
                 IsReadOnly="True"
                 ScrollViewer.CanContentScroll="True"
                 ScrollViewer.HorizontalScrollBarVisibility="Auto"
                 ScrollViewer.VerticalScrollBarVisibility="Auto"
                 Text="{Binding EndText,
                                Mode=OneWay}" />
        <TextBlock Grid.Row="7"
                   Margin="5"
                   VerticalAlignment="Center"
                   FontSize="16"
                   Text="Size:" />
        <TextBlock Grid.Row="7"
                   Grid.Column="1"
                   Margin="5"
                   VerticalAlignment="Center"
                   FontSize="16"
                   Text="{Binding Size}" />
        <Button Grid.Row="7"
                Grid.Column="1"
                Margin="5"
                HorizontalAlignment="Right"
                Command="{Binding OpenCommand}"
                Content="Open"
                IsDefault="true"
                Padding="20,5,20,5" />
    </Grid>
</controls:MetroWindow>
